<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // ES6中，默认为函数的形参设置默认值
        let aaa = (x = 10, y) => {
                console.log(x + y)
            } //
        aaa(1, 10) //11
        aaa(10) //f
        let bbb = (x, y = 10) => {
            console.log(x + y);
        }
        aaa(1, 10) //20
        aaa(10) //20
    </script>
</body>

</html>